import { createWebHashHistory, createRouter } from 'vue-router'

// 公共路由
export const constantRoutes = [
  {
    path: '/401',
    component: () => import('@/views/error/401'),
    hidden: true
  },
  {
    path: '/chuku',
    component: () => import('@/views/sc/chuku'),
    hidden: true
  },
  {
    path: '/list_demo',
    component: () => import('@/views/a_shy/demo/list_demo.vue'),
    hidden: true
  },
  {
    path: '/list1',
    component: () => import('@/views/a_shy/demo/list.vue'),
    hidden: true
  },
  {
    path: '/cz_2',
    component: () => import('@/views/a_shy/demo/cz_2.vue'),
    hidden: true
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes: constantRoutes,
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return { top: 0 }
    }
  },
});

export default router;
